<?php

chdir('../');

include('includes/setUp.php');

if ($user == null )
  globalFunc::redirect(WebRoot.'index.php?errMsg='.rawurlencode(T_('You have to be logged on!')));

try {
  $album = new Album();
  $album = $db->find('Album',$_GET['album']);

  if ($album->User != $user)
    globalFunc::redirect(WebRoot.'index.php?errMsg='.rawurlencode(T_('You aren\'t owner this album!')));


  $db->remove($album);

  $db->flush();

  } catch (Exception $ex) {
    globalFunc::redirect(WebRoot.'index.php?errMsg='.rawurlencode($ex->getMessage()));
  }

globalFunc::redirect();
